#include <cstdio>
#include <iostream>
using namespace std;

void MaxMin(int *a, int *b, int c) {
  cout<<*a<<' '<<*b<<' '<<c<<endl;
  int maxx, minn;
  if(*a > *b) { maxx = *a; minn = *b; }
  else { maxx = *b; minn = *a; }
  if(c > maxx) maxx = c;
  else minn = c;
  cout<<maxx<<' '<<minn<<endl;
  *a = maxx; 
  *b = minn;
}

int main() {
  int a = 1, b = 3, c = 2;
  MaxMin(&a, &b, c);
  cout<<a<<' '<<b<<endl;
  return 0;
}